package com.justnow.offer;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

public class Solution55 {
    private Object o = new Object();
    private Solution55 s = new Solution55();
    public int maxDepth(TreeNode root) {
        if (root == null)
            return 0;
        return recu(root);
    }

    private int recu(TreeNode root) {

        if (root == null)
            return 0;
        return Math.max(recu(root.left), recu(root.right)) + 1;
    }

    public static void main(String[] args) {
        HashMap<Integer, Integer> map = new HashMap<>();
        map.put(1, 10);
        map.put(2, 30);
        map.put(3, 40);

    }
}

class TreeNode {
    int val;
    TreeNode left;
    TreeNode right;
    public TreeNode(int val) {
        this.val = val;
    }
}
